#!/usr/bin/env bash
main(){
  if [ $1 == 'dev' ]
  then
    nohup /opt/miniconda3/envs/ai-platform-env-new/bin/gunicorn -c config/gun.conf.py 'run_ai_platform_publish:run(run_type="DEVELOPMENT")' > platform.log 2>&1 &
  elif [ $1 == 'test' ]
  then
    nohup /opt/miniconda3/envs/ai-platform-env-new/bin/gunicorn -c config/gun.conf.py 'run_ai_platform_publish:run(run_type="TESTING")' > platform.log 2>&1 &
  elif [ $1 == 'prd' ]
  then
    nohup /opt/miniconda3/envs/ai-platform-env-new/bin/gunicorn -c config/gun.conf.py 'run_ai_platform_publish:run(run_type="PRODUCTION")' > platform.log 2>&1 &
  else
    nohup /opt/miniconda3/envs/ai-platform-env-new/bin/gunicorn -c config/gun.conf.py 'run_ai_platform_publish:run(run_type="DEVELOPMENT")' > platform.log 2>&1 &
  fi
}

$(main $1)